﻿<UserControl x:Class="Visuals.Panes.WordsListControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Grid>
        <TextBox Background="#FFBCC7D8" BorderThickness="1" BorderBrush="LightGray" x:Name="wordSearchTextbox" />
        <ListView BorderThickness="0" Margin="0, 20, 0, 0" IsTextSearchEnabled="True" TextSearch.TextPath="Word" ItemsSource="{Binding AllWords}" MouseDoubleClick="wordsPane_MouseDoubleClick" x:Name="wordsPane">
            <ListView.Resources>
                <ContextMenu x:Key="ItemContextMenu">
                    <MenuItem Header="Виж в свързаните документи" Icon="../Images/Green.png" Click="OpenSearchWindow" />
                    <MenuItem Header="Добави в графиката" Icon="../Images/Green.png" Click="AddWordToGraph" />
                </ContextMenu>
            </ListView.Resources>
            <ListView.ItemContainerStyle>
                <Style TargetType="{x:Type ListViewItem}">
                    <Setter Property="ContextMenu" Value="{StaticResource ItemContextMenu}"/>
                </Style>
            </ListView.ItemContainerStyle>


            <ListView.View>
                <GridView>                   
                    <GridViewColumn Width="50" Header="ID" DisplayMemberBinding="{Binding Id}" />
                    <GridViewColumn Width="130" Header="Дума" DisplayMemberBinding="{Binding Word}" />
                </GridView>
            </ListView.View>
        </ListView>
    </Grid>
</UserControl>
